import Promise from "./promise-5.js";

let promise2 = new Promise((resolve, reject) => {
  resolve("ok");
}).then(() => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(
        new Promise((resolve, reject) => {
          setTimeout(() => {
            reject(
              new Promise((resolve, reject) => {
                setTimeout(() => {
                  resolve(100);
                }, 1000);
              })
            );
          }, 1000);
        })
      );
    }, 1000);
  });
});

promise2.then(
  (value) => {
    console.log("成功", value);
  },
  (reason) => {
    console.log("失败", reason);
  }
);
